package com.example.graalvm21.task;

import com.example.graalvm21.model.entity.master.Student;
import com.example.graalvm21.model.entity.master.User;
import com.example.graalvm21.model.entity.slave1.PortShaanxiLog;
import com.example.graalvm21.service.master.StudentService;
import com.example.graalvm21.service.master.UserService;
import com.example.graalvm21.service.slave1.PortShaanxiLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * <p>定时任务-测试</p>
 *
 * @author wz
 * @date 2025/10/29 14:03
 */
@Component
public class TestTask {

    @Autowired
    private UserService userService;
    @Autowired
    private StudentService studentService;
    @Autowired
    private PortShaanxiLogService portShaanxiLogService;

    /**
     * @title 测试
     *
     * @author wz
     */
    @Async
    @Scheduled(cron = "*/3 * * * * ?")
    public void test() {
        User user = userService.getById(1);
        Student student = studentService.getById(1);
        PortShaanxiLog portShaanxiLog = portShaanxiLogService.getById(22834);
        System.out.println();
    }
}
